package main

import "fmt"

func main()  {

	var arr  =[]int{7,1,5,3,6,4}
	buy :=arr[0]
	max := 0
	for i :=1;i <len(arr);i++{
		if arr[i] < buy {
			buy = arr[i]
		}
		tem := arr[i] - buy
		if tem > max {
          max = tem
		}
	}
	fmt.Println(max)
}